<?=$this->load->view('public/v_html')?>
<title><?=$this->_lang['geili']?></title>
<script type="text/javascript" src="<?=base_url ( '/js/jquery.masonry.min.js' )?>"></script>
<script type="text/javascript" src="<?=base_url ( '/js/jquery.lazyload.js' )?>"></script>
<script type="text/javascript">
<!--
$(function(){
	$("img").lazyload({
		effect:"fadeIn"
	})
})
//-->
</script>
<style>
/* tooltip */
#tooltip {
	position: fixed;
	border: 1px solid #ccc;
	background: #333;
	padding: 2px;
	display: none;
	color: #fff;
}

#page {
	width: 960px;
	margin: 0 auto;
	overflow: auto;
}

#main {
	background: #FFF;
	height: 590px;
	float: left;
	width: 960px;
}

.item {
	border: 1px solid #EEE;
	float: left;
	display: inline;
	padding: 10px;
	margin: 10px 0px 0 14px;
	position: relative;
}

.item img {
	border: none;
	border: #F00 solid 1px;
}

.items:hover {
	background: #3CF
}

.tgms9 {
	color: black;
	font-size: 14px;
	font-weight: bold;
	line-height: 20px;
}

.tgms9 A {
	color: black
}

.tgms9 A:hover {
	color: black
}

.pprice {
	width: 260px;
	height: 20px;
	background: #5A554F;
	filter: progid:DXImageTransform.Microsoft.Alpha(opacity=60 );
	-moz-opacity: 0.6;
	opacity: 0.6;
	position: relative;
	top: -20px;
	color: #FFF;
}

.pprice .left {
	margin-left: 20px;
}

.pprice .right {
	margin-left: 40px;
}

.tbk0 {
	cursor: pointer;
	background: url(<?=base_url('images/xxd.png')?>) no-repeat 0 0;
	height: 48px;
	margin: 0 auto auto auto;
	position: relative;
	top: -20px;
	display: block;
}

.tgms16 {
	height: 18px;
	line-height: 18px;
	font-size: 12px;
	font-weight: bold;
	color: #F5D09A;
}

.tgms16 div {
	float: left;
}

.deldiv {
	margin-left: 7px
}

.spandiv {
	margin-left: 7px;
}

.tgms19 {
	width: 160px;
	height: 30px;
	float: left;
	font-weight: bold;
	line-height: 30px;
	font-family: 微软雅黑;
	font-size: 28px;
	color: white;
}

b {
	height: 32px;
	width: 86px;
	background: url(<?=base_url('images/xxd.png')?>) no-repeat 0 -456px;
	display: block;
	cursor: pointer;
	position: relative;
	left: 58px;
	top: 15px;
}

.buy-action:hover {
	text-decoration: none;
	color: white;
}

.price {
	float: left;
	color: white;
	font: bold 24px "Arial";
	letter-spacing: -2px;
	text-shadow: 0 0 0 transparent, 1px 1px 1px #8A181B;
}
.tiel{
width:260px;
}
</style>
<script language="javascript">

$(document).ready(function (){
	$("a[name=get_goods]").click(function (){
	$("#get_info").html("<img src='<?=base_url('images/loading.gif') ?>'/>");
	$.ajax({
		type:'POST',
		datatype:'html',
		url:'<?=base_url('index.php/tbk/get_goods')?>',
		data:{"search":$("input[name=search]").val()},
		success:function (result){
			eval("var ret = "+result);
			if(ret.error == 1){
				alert(ret.msg);
				$("#get_info").html('');
			}
			else{
				$("#get_info").html(ret.html);
			}
		}
		})	
	})
	
})

$(document).ready(function (){
	$("a[name=get_shops]").click(function (){
	$("#get_shop").html("<img src='<?=base_url('images/loading.gif') ?>'/>");
	$.ajax({
		type:'POST',
		datatype:'html',
		url:"<?=base_url('index.php/tbk/shop_search')?>",
		data:{"shop":$("input[name=shop]").val()},
		success:function (result){
			eval("var ret = "+result);
			if(ret.error==1)
			{
				alert(ret.msg);
				$("#get_shop").html('');
			}
			else{
				$("#get_shop").html(ret.html);
			}	
		}
		})	
	})
})


function add_fav(){
	var d= document.location.href;
	var c="<?=$this->_lang['geili']?>";
	if(document.all){
		window.external.AddFavorite(d,c);
	}else{
		if(window.sidebar){window.sidebar.addPanel(c,d,"");}else{alert("<?=$this->_lang['add_fav_error']?>");}
	}
}

function goods(title,pageno){
	$("#get_info").html("<img src='<?=base_url('images/loading.gif') ?>'/>");
	$.ajax({
		type:'POST',
		url:'<?=base_url('index.php/tbk/search')?>',
		data:{"name":title,"pageno":pageno},
		success:function (result){
			eval("var ret = "+result);
			if(ret.error == 1){
				alert(ret.msg);
			}
			else{
				$("#get_info").html(ret.html);
			}
		}
		})
}
//显示大图
$("#get_info table img").live("mouseover", function (e){
	//显示大图
	var x = 10;
	var y = -300;
	var tooltip = "<div id='tooltip'><img src='"+ this.src +"' alt='产品预览图' height='600px' /></div>"; //创建 div 元素
	$("body").append(tooltip);	//把它追加到文档中						 
	$("#tooltip")
		.css({
			"top": "50px",
			"left": "150px"
		}).show("fast");	  //设置x坐标和y坐标，并且显示
})
$("#get_info table img").live("mouseout", function (e){
	$("#tooltip").remove();	 //移除 
})

function gowhere1(formname)
{
 var url;
 if (formname.myselectvalue.value == "0")
 {
  url = "http://www.baidu.com/baidu";
  document.search_form1.tn.value = "baidu";
  formname.method = "get";
 }
 if (formname.myselectvalue.value == "1")
 {
  url = "http://mp3.baidu.com/m";
  document.search_form1.tn.value = "baidump3";
  document.search_form1.ct.value = "134217728";
  document.search_form1.lm.value = "-1";
  formname.method = "get";
 }

 if (formname.myselectvalue.value == "4")
 {
  document.search_form1.tn.value = "news";
  document.search_form1.cl.value = "2";
  document.search_form1.rn.value = "20";
  document.search_form1.ct.value = "1";
  url = "http://news.baidu.com/ns";
  formname.method = "get";
 }
 if (formname.myselectvalue.value == "5")
 {
  document.search_form1.tn.value = "baiduimage";
  document.search_form1.ct.value = "201326592";
  document.search_form1.cl.value = "2";
  document.search_form1.lm.value = "-1";
  document.search_form1.ie.value = 'utf-8';
  url = "http://image.baidu.com/i";
  formname.method = "get";
}
if (formname.myselectvalue.value == "6")
 {
  url = "http://post.baidu.com/f";
  document.search_form1.tn.value = "baiduPostSearch";
  document.search_form1.ct.value = "352321536";
  document.search_form1.rn.value = "10";
  document.search_form1.lm.value = "65536";
  formname.method = "get";
 }

  formname.action = url;
 return true;
}

</script>
</head>
<body>
<?php 
$lang["modle"] = $modle;
if(isset($usermail)):
$lang["usermail"] = $usermail;
?>
<?=$this->load->view('public/v_header',$lang)?>
<?php else: ?>
<?=$this->load->view('public/v_header',$lang)?>
<?php endif; ?>
	<div id="body-wrapper">
		<div id="main-content">
			<div class="clear"></div>
			<div class="content-box" align="center">
				<div class="content-box-header">
					<h3 align="center"><?=$this->_lang['geili']?><a
							onclick="add_fav();"><?=$this->_lang['add_fav']?></a>
					</h3>&nbsp;<h3><?=$this->_lang['QQ']?></h3>&nbsp;<a href="<?=site_url('login/qq')?>" ><img src="<?=base_url('images/qq.png')?>" /></a>
					<div class="clear"></div>
				</div>
				<div class="content-box-content">
					<div class="tab-content default-tab" id="tab4" align="center">

						<div class="baidu">
							<form name="search_form1" target="_blank"
								onsubmit="return gowhere1(this)">
								<input name=myselectvalue type=hidden value=0 /> <input name=tn
									type=hidden /> <input name=ct type=hidden /> <input name=lm
									type=hidden /> <input name=cl type=hidden /> <input name=rn
									type=hidden /> <input name=ie type=hidden value="utf-8" />
								<DIV align=center>
									<a href="http://www.baidu.com/"><img
										src="http://www.baidu.com/img/baidu_sylogo1.gif" alt="Baidu"
										align="bottom" border="0"></a>
								</DIV>
								<div>
									<input name=myselect
										onclick=javascript:this.form.myselectvalue.value=4; type=radio
										value=0 /> <font>新闻</font> <input CHECKED name=myselect
										onclick=javascript:this.form.myselectvalue.value=0; type=radio
										value=0 /> <font>网页</font> <input name=myselect
										onclick=javascript:this.form.myselectvalue.value=1; type=radio
										value=1 /> <font>mp3</font> <input name=myselect
										onclick=javascript:this.form.myselectvalue.value=6; type=radio
										value=0 /> <font>贴吧</font> <input name=myselect
										onclick=javascript:this.form.myselectvalue.value=5; type=radio
										value=0 /> <font>图片</font>
								</div>
								<input type="text" name="word" id="word" maxlength="100"
									style="width: 474px; height: 30px" autocomplete="no"> <input
									class="submit" type="submit" value="百度搜索" />
							</form>
						</div>

						<form>
							<p>TB返利</p>
							<div>
								<input type="text" class="text-input small-input" name="search"
									id="search_good"
									onblur="if(this.value==''){this.value='<?=$this->_lang['search']?>'};"
									value="<?=$this->_lang['search']?>"
									onclick="if(this.value=='<?=$this->_lang['search']?>'){this.value=''}"></input>
								<a class="button" name="get_goods"><?=$this->_lang['tbk_search']?></a>
							</div>
							<div>
								<input type="text" class="text-input small-input" name="shop"
									id="search_shop"
									onblur="if(this.value==''){this.value='<?=$this->_lang['search_shop']?>' };"
									value="<?=$this->_lang['search_shop']?>"
									onclick="if(this.value=='<?=$this->_lang['search_shop']?>'){this.value=''}"></input>
								<a class="button" name="get_shops"><?=$this->_lang['tbk_shop']?></a>
							</div>
							<p>----------TBCOM----------</p>
							<div align="center">
								<a>衣服</a> <a class="button" onclick="goods('打底衫')">打底衫</a> <a
									class="button" onclick="goods('连衣裙')">连衣裙</a> <a class="button"
									onclick="goods('短裙')">短裙</a> <a class="button"
									onclick="goods('衬衫')">衬衫</a> <a class="button"
									onclick="goods('休闲裤')">休闲裤</a> <a class="button"
									onclick="goods('T恤')">T恤</a> <a class="button"
									onclick="goods('西裤')">西裤</a> <a class="button"
									onclick="goods('西服')">西服</a> &nbsp; <a>名服</a> <a class="button"
									onclick="goods('裂帛')">裂帛</a> <a class="button"
									onclick="goods('歌莉娅')">歌莉娅</a> <a class="button"
									onclick="goods('太平鸟')">太平鸟</a> <a class="button"
									onclick="goods('ONLY')">ONLY</a> <a class="button"
									onclick="goods('茵曼')">茵曼</a> <a class="button"
									onclick="goods('GXG')">GXG</a> <a class="button"
									onclick="goods('七匹狼')">七匹狼</a> <a class="button"
									onclick="goods('卡宾')">卡宾</a> <br /> <a>鞋子</a> <a class="button"
									onclick="goods('凉鞋')">凉鞋</a> <a class="button"
									onclick="goods('高跟鞋')">高跟鞋</a> <a class="button"
									onclick="goods('运动鞋')">运动鞋</a> <a class="button"
									onclick="goods('增高鞋')">增高鞋</a> <a class="button"
									onclick="goods('拖鞋')">拖鞋</a> <a class="button"
									onclick="goods('旅游鞋')">旅游鞋</a> <a class="button"
									onclick="goods('登山鞋')">登山鞋</a> &nbsp; <a>名鞋</a> <a
									class="button" onclick="goods('百丽')">百丽</a> <a class="button"
									onclick="goods('达芙妮')">达芙妮</a> <a class="button"
									onclick="goods('卓尼诗')">卓尼诗</a> <a class="button"
									onclick="goods('千百度')">千百度</a> <a class="button"
									onclick="goods('百思图')">百思图</a> <a class="button"
									onclick="goods('奥康')">奥康</a> <a class="button"
									onclick="goods('红蜻蜓')">红蜻蜓</a> <a class="button"
									onclick="goods('康奈')">康奈</a> <br /> <a>护肤</a> <a class="button"
									onclick="goods('洗面奶')">洗面奶</a> <a class="button"
									onclick="goods('爽肤水')">爽肤水</a> <a class="button"
									onclick="goods('护肤霜')">护肤霜</a> <a class="button"
									onclick="goods('防晒霜')">防晒霜</a> <a class="button"
									onclick="goods('隔离霜')">隔离霜</a> <a class="button"
									onclick="goods('BB霜')">BB霜</a> <a class="button"
									onclick="goods('卸妆水')">卸妆水</a> &nbsp; <a>名品</a> <a
									class="button" onclick="goods('相宜本草')">相宜本草</a> <a
									class="button" onclick="goods('自然堂')">自然堂</a> <a class="button"
									onclick="goods('御泥坊')">御泥坊</a> <a class="button"
									onclick="goods('欧莱雅')">欧莱雅</a> <a class="button"
									onclick="goods('曼秀雷敦')">曼秀雷敦</a> <a class="button"
									onclick="goods('雅诗兰黛')">雅诗兰黛</a> <a class="button"
									onclick="goods('欧碧泉')">欧碧泉</a>
							</div>
							<div id="get_info">
								<div id="page">
									<div id="main">
										<!-- asdf^^^^^^^^^^^^^^^^^^ -->
										<?php foreach ($goods_hot as $v):?>
										<div class="item">
											<div class="tgms9 tiel">
												<a href="<?=$v['click_url'] ?>" target="_blank" class="thickbox" title="<?=$v['title'] ?>">
												<?=$v['title'] ?>
												</a>
											</div>
											<a href="<?=$v['click_url'] ?>" target="_blank" > <img width="260"
												src="<?=$v['pic_url'] ?>_210x210.jpg" /></a>
											<div class="pprice">
												<span class="left">已售<em><?=$v['volume'] ?></em></span><span class="right">返利<em><?=$v['commission'] ?></em></span>
											</div>
											<div class="tbk0">
												<div class="tgms16">
													<div class="deldiv">
														<del><?=$v['price'] ?>元</del>
													</div>
													<div class="spandiv">
														<span>结束时间: <?=$v['coupon_end_time'] ?></span>
													</div>
													<div class="clear"></div>
													<a href="<?=$v['click_url'] ?>" target="_blank" > <span class="price">￥<em><?=$v['coupon_price'] ?></em></span> <b class="btn"></b></a>
													<div class="clear"></div>
												</div>
											</div>
										</div>
										<?php endforeach;?>
										<!-- end^^^^^^^^^^^^^^^^^^^ -->
									</div>
									<div class="clear"></div>
								</div>
							</div>
							<div id="get_shop"></div>
						</form>
					</div>
				</div>
			</div>
			<!-- End #tab1 -->
			<div class="clear"></div>
			<div>
				友情链接:<br/> <a href="http://zhaizhaixiaofu.taobao.com/" target="_blank"><img src="<?=base_url('images/link/link.jpg') ?>" /></a>
			</div>
			<div id="footer">
				<small> <?=$this->_lang['copy_right']?> | Powered by <a
					href="http://www.geili0574.com">TBCOM</a> | <a href="#">Top</a>
				</small>
			</div>
		</div>

	</div>
	<script language="javascript">
$("#search_good").keydown(function (e){
	if(e.keyCode == 13){
		$("#get_info").html("<img src='<?=base_url('images/loading.gif') ?>'/>");
		$.ajax({
			type:'POST',
			datatype:'json',
			url:"<?=base_url('index.php/tbk/get_goods')?>",
			data:{"search":$("input[name=search]").val()},
			success:function (result){
				eval("var ret = "+result);
				if(ret.error==1)
				{
					alert(ret.msg);
					$("#get_info").html('');
				}
				else{
					$("#get_info").html(ret.html);
					
				}	
			}
			})
		}
	});

	$("#search_shop").keydown(function (e){
	if(e.keyCode == 13){
		$("#get_shop").html("<img src='<?=base_url('images/loading.gif') ?>'/>");
		$.ajax({
			type:'POST',
			datatype:'json',
			url:"<?=base_url('index.php/tbk/shop_search')?>",
			data:{"shop":$("input[name=shop]").val()},
			success:function (result){
				eval("var ret = "+result);
				if(ret.error==1)
				{
					alert(ret.msg);
					$("#get_shop").html('');
				}
				else{
					$("#get_shop").html(ret.html);
					
				}	
			}
		})
	}
});
</script>
	<!-- 百度搜索框提示 -->
	<script charset="gbk" src="<?=base_url('js/opensug.js') ?>"></script>
	<script type="text/javascript">

	var params = {
	"XOffset":0, //提示框位置横向偏移量,单位px
	"YOffset":0, //提示框位置纵向偏移量,单位px
	"width":204, //提示框宽度，单位px
	"fontColor":"#999", //提示框文字颜色
	"fontColorHI":"#FFF",	//提示框高亮选择时文字颜色
	"fontSize":"12px",		//文字大小
	"fontFamily":"宋体",	//文字字体
	"borderColor":"gray", 	//提示框的边框颜色
	"bgcolorHI":"#03c",		//提示框高亮选择的颜色
	"sugSubmit":false		//在选择提示词条是是否提交表单
	};

 	BaiduSuggestion.bind("word",params);

 	$(function(){
 	    var $container = $('#main');
 	    $container.imagesLoaded( function(){
 	      $container.masonry({
 	        itemSelector : '.item'
 	      });
 	    });
 	  });
	
</script>
</body>
</html>
